package cn.stylefeng.guns.modular.business.frequency.ordersub.service;

import cn.stylefeng.guns.core.pojo.page.PageResult;
import cn.stylefeng.guns.core.pojo.response.ResponseData;
import cn.stylefeng.guns.modular.business.app.controller.dto.CreatePayOrderDTO;
import cn.stylefeng.guns.modular.business.frequency.ordermodifydetail.entity.OrderModifyDetail;
import cn.stylefeng.guns.modular.business.frequency.ordersub.entity.OrderSub;
import cn.stylefeng.guns.modular.business.frequency.ordersub.model.param.OrderDTO;
import cn.stylefeng.guns.modular.business.frequency.ordersub.model.param.OrderSubParam;
import cn.stylefeng.guns.modular.business.frequency.ordersub.model.param.OrderVO;
import cn.stylefeng.guns.modular.business.frequency.ordersub.model.result.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;

import java.math.BigDecimal;
import java.util.List;

/**
 * 子订单 服务类
 *
 * @author yujie
 * @date 2023/05/09 17:16
 */
public interface OrderSubService extends IService<OrderSub> {

    /**
     * 分页查询子订单
     *
     * @author yujie
     * @date 2023/05/09 17:16
     */
    PageResult<OrderSub> page(OrderSubParam orderSubParam);

    /**
     * 查询所有子订单
     *
     * @author yujie
     * @date 2023/05/09 17:16
     */
    List<OrderSub> list(OrderSubParam orderSubParam);

    /**
     * 添加子订单
     *
     * @author yujie
     * @date 2023/05/09 17:16
     */
    void add(OrderSubParam orderSubParam);

    /**
     * 删除子订单
     *
     * @author yujie
     * @date 2023/05/09 17:16
     */
    void delete(OrderSubParam orderSubParam);

    /**
     * 编辑子订单
     *
     * @author yujie
     * @date 2023/05/09 17:16
     */
    void edit(OrderSubParam orderSubParam);

    /**
     * 查看详情子订单
     *
     * @author yujie
     * @date 2023/05/09 17:16
     */
    OrderSub detail(OrderSubParam orderSubParam);

    /**
     * 修改状态（字典 0正常 1停用 2删除）
     *
     * @author yujie
     * @date 2023/05/09 17:16
     */
    void changeStatus(OrderSubParam orderSubParam);


    boolean checkOrderCreate(OrderVO orderVO, StringBuilder errorMsg);

    /** 创建订单 */
    ResponseData createOrder(OrderVO orderVO);

    String getLastOrderNo(Long tenantId);

    boolean checkOrderUpdate(OrderVO orderVO, StringBuilder errorMsg);

    ResponseData updateOrder(OrderVO orderVO);

    ResponseData getOrderListPage(OrderDTO orderDTO);

    void setSiteCityCodeList(OrderDTO orderDTO, Long sysLoginUserId);

    PkgOrderSub getOrderDetail(Long id, Integer scene, Long transportId);

    OrderVO getOrderVOByOrderIdList(List<Long> idList);

    OrderProgressVO getSubOrderStatus(String id);

    List<OrderModifyDetail> getOrderModifyRecord(Long id);

    List<PkgOrderSubBase> getOrderInfos(List<Long> orderIds);

    void multiCancel(List<String> idList);

    boolean checkMultiCancel(List<String> idList, StringBuilder errorMsg);

    boolean checkOrderFinanceUpdate(OrderSub orderSub, StringBuilder errorMsg);

    void orderFinanceUpdate(OrderSub orderSub);

    void updateOrderTransportCost(PkgTransportLevelDetailSimple orderTransport);

    List<OrderSubExport> getOrderExportList(OrderDTO orderDTO);

    void updateVin(Long id, String vin);

    void modifyOrderFeeDetail(Long orderId, int type, BigDecimal pickCarFee, BigDecimal pickCarFee1, Long settlementId, String settlementName, String settlementPhone) throws Exception;

}